home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / OCETemplates.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  57.6 KB  |  1,723 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        OCETemplates.p
  3.  
  4.      Contains:    Apple Open Collaboration Environment Templates Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT OCETemplates;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __OCETEMPLATES__}
  30. {$SETC __OCETEMPLATES__ := 1}
  31.  
  32. {$I+}
  33. {$SETC OCETemplatesIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __EVENTS__}
  43. {$I Events.p}
  44. {$ENDC}
  45. {    Quickdraw.p                                                    }
  46. {        MixedMode.p                                                }
  47. {        QuickdrawText.p                                            }
  48. {    OSUtils.p                                                    }
  49. {        Memory.p                                                }
  50.  
  51. {$IFC UNDEFINED __CONTROLS__}
  52. {$I Controls.p}
  53. {$ENDC}
  54. {    Menus.p                                                        }
  55.  
  56. {$IFC UNDEFINED __APPLEEVENTS__}
  57. {$I AppleEvents.p}
  58. {$ENDC}
  59. {    Errors.p                                                    }
  60. {    EPPC.p                                                        }
  61. {        AppleTalk.p                                                }
  62. {        Files.p                                                    }
  63. {            Finder.p                                            }
  64. {        PPCToolbox.p                                            }
  65. {        Processes.p                                                }
  66. {    Notification.p                                                }
  67.  
  68. {$IFC UNDEFINED __DIALOGS__}
  69. {$I Dialogs.p}
  70. {$ENDC}
  71. {    Windows.p                                                    }
  72. {    TextEdit.p                                                    }
  73.  
  74. {$IFC UNDEFINED __OCE__}
  75. {$I OCE.p}
  76. {$ENDC}
  77. {    Aliases.p                                                    }
  78. {    Script.p                                                    }
  79. {        IntlResources.p                                            }
  80.  
  81. {$IFC UNDEFINED __OCESTANDARDMAIL__}
  82. {$I OCEStandardMail.p}
  83. {$ENDC}
  84. {    OCEAuthDir.p                                                }
  85. {    OCEMail.p                                                    }
  86. {        DigitalSignature.p                                        }
  87. {        OCEMessaging.p                                            }
  88.  
  89. {$PUSH}
  90. {$ALIGN MAC68K}
  91. {$LibExport+}
  92.  
  93. CONST
  94.     kDETAspectVersion            = -976;
  95.     kDETInfoPageVersion            = -976;
  96.     kDETKillerVersion            = -976;
  97.     kDETForwarderVersion        = -976;
  98.     kDETFileTypeVersion            = -976;
  99.  
  100. {    "Normal" separation for template IDs within the file (this is just a suggestion; you can use whatever
  101.     separation you like, so long as two separate templates don't have overlapping resources): }
  102.     kDETIDSep                    = 250;
  103.  
  104. { A few predefined base IDs (again, just suggestions): }
  105.     kDETFirstID                    = 1000;
  106.     kDETSecondID                = 1000 + kDETIDSep;
  107.     kDETThirdID                    = 1000 + 2 * kDETIDSep;
  108.     kDETFourthID                = 1000 + 3 * kDETIDSep;
  109.     kDETFifthID                    = 1000 + 4 * kDETIDSep;
  110.  
  111. {    Templates consist of a set of associated resources, at constant offsets from a "base ID" set by the
  112.     signature resource of the template. In the case of aspect templates, most of the resources in the
  113.     template are accessible from the template as property default values. The property number is the same
  114.     as the offset from the base ID of the resource. In describing the resources which make up templates,
  115.     we give the type, the offset, and a description. For aspect templates, the offset is also the property #. 
  116.     
  117.     All templates include the following resource fork resources:
  118.  
  119.      Type    Offset                        Description
  120.      ----    ------                        -----------
  121.     'rstr'    kDETTemplateName            Contains the name of the template
  122.  
  123. }
  124.     kDETTemplateName            = 0;
  125.  
  126. {    Aspects, info-pages, and forwarders include the following as well:
  127.  
  128.      Type    Offset                        Description
  129.      ----    ------                        -----------
  130.     'rstr'    kDETRecordType                Contains the type of record this applies to
  131.     'rstr'    kDETAttributeType            Contains the type of attribute this applies to
  132.     'detn'    kDETAttributeValueTag        Contains the tag of the attribute values this applies to
  133.  
  134. }
  135.     kDETRecordType                = 1;
  136.     kDETAttributeType            = 2;
  137.     kDETAttributeValueTag        = 3;
  138.  
  139. { ************************************ Aspects }
  140. {    In the case of aspects, property numbers and resource id offsets are the same. Therefore, some of the following
  141.     defines are used for resource offsets, some are used for dynamically generated properties, and some are used for
  142.     both (i.e., properties which may be dynamically generated, but if they aren't, then they're taken from the
  143.     resource). Resource types are given in all cases below; even if there is no actual resource (for example in
  144.     the case of kDETAspectName), it indicates the type for the dynamically generated property. A resource type of
  145.     'rstr' corresponds to a property type of kDETPrTypeString; type 'detn' corresponds to kDETPrTypeNumber; and
  146.     'detb' corresponds to kDETPrTypeBinary.
  147.  
  148.      Type    Offset                        Description
  149.      ----    ------                        -----------
  150.     'deta'    0                            Identifies the type of resource
  151.     'detc'    kDETCode                    Is the code resource, if any is used
  152.     'ICN#'    kDETAspectMainBitmap
  153.     'icl8'    kDETAspectMainBitmap
  154.     'icl4'    kDETAspectMainBitmap
  155.     'ics#'    kDETAspectMainBitmap
  156.     'ics8'    kDETAspectMainBitmap
  157.     'ics4'    kDETAspectMainBitmap
  158.     'sicn'    kDETAspectMainBitmap        Is the icon suite to display for this item type (main aspect only)
  159.     'rstr'    kDETAspectName                Contains the name of the item (attribute main aspect only)
  160.     'rst#'    kDETAspectCategory            Contains the internal categories for the record type (main aspect only)
  161.     'rst#'    kDETAspectExternalCategory    Contains the external (user-visible) names which correspond to the categories in
  162.                                         kDETAspectCategory; if this resource is not present, external names are taken from
  163.                                         another template; if no other template provides an external name for a given internal
  164.                                         category, the internal name is used as the external name (main aspect only)
  165.     'rstr'    kDETAspectKind                Is the item kind to display (main aspect only)
  166.     'detn'    kDETAspectGender            Is the gender of this kind of object for internationalization (main aspect only)
  167.     'rstr'    kDETAspectWhatIs            Is the string for balloon help when item is in sublist (main aspect only)
  168.     'rstr'    kDETAspectAliasKind            Is the item kind to display for aliases to this type of item (main aspect only)
  169.     'detn'    kDETAspectAliasGender        Is the gender of an alias to this kind of object for internationalization (main aspect only)
  170.     'rstr'    kDETAspectAliasWhatIs        Is the string for balloon help when an alias to the item is in sublist (main aspect only)
  171.     'rst#'    kDETAspectBalloons            Is a list of strings for balloon help; for each item in an info-page, it's
  172.                                         property # times 2 is used as an index into this array; if the item is not editable,
  173.                                         then the property # times 2 plus 1 is used
  174.     'rstr'    kDETAspectNewMenuName        Is the string to be used for the user to select new item creation; for records, the
  175.                                         string is used as a menu entry in the Catalogs menu; for attributes, the string
  176.                                         is used in a selection dialog invoked by an "Add..." button
  177.     'rstr'    kDETAspectNewEntryName        Is the name to be used for new records (with a digit appended if not unique)
  178.     'detb'    kDETAspectNewValue            Is the value to use when creating a new attribute value; the first four bytes
  179.                                         is the tag; the rest is the attribute value contents
  180.     'detn'    kDETAspectSublistOpenOnNew    If true (non-zero), automatically open newly created entries (property can be set
  181.                                         from a code resource, or via a default value in a resource)
  182.     'dett'    kDETAspectLookup            Is the attribute-to-property translation table
  183.     'rstr'    kDETAspectDragInString        Is a string describing the action of dragging into this aspect (if any)
  184.     'rstr'    kDETAspectDragInVerb        Is a single, short word that's the verb of the action (like "add" or "drop"; if
  185.                                         there's any doubt, use "OK")
  186.     'rstr'    kDETAspectDragInSummary        Is a short phrase that describes the action, suitable to be included in a selection list
  187.     'rst#'    kDETAspectRecordDragIn        Is a list of type pairs; in each pair, the first is the type of a record which
  188.                                         can be dragged into this aspect, and the second is the attribute type to store
  189.                                         the reference in
  190.     'rst#'    kDETAspectRecordCatDragIn    Is a list of category/attribute type pairs; in each pair, the first is the
  191.                                         category of records which can be dragged in, and the second is the type of
  192.                                         attribute to place the alias in
  193.     'rst#'    kDETAspectAttrDragIn        Is a list of type triples; in each triple, the first is the record type which can be
  194.                                         dragged from (or "" for any), the second is the attribute type which can be dragged
  195.                                         in, and the third is the attribute type to store the new attribute in
  196.     'rst#'    kDETAspectDragOut            Is a list of attribute types which can be dragged out of this aspect (an 'rst#'
  197.                                         resource with no entries means nothing can be dragged out; no 'rst#' resource means
  198.                                         everything can be dragged out)
  199.     'detm'    kDETAspectViewMenu            Is a table to fill in the view menu from
  200.     'detp'    kDETAspectReverseSort        Is a table listing which properties to sort in reverse order
  201.     'detw'    kDETAspectInfoPageCustomWindow    Is a specification of a custom window size/placement & whether to use the
  202.                                             page-selector (main aspect only)
  203.     'detv'    kDETAspectInfoPageCustomWindow    Is a view list which is common to all info-pages (main aspect only)
  204. }
  205.     kDETAspectCode                = 4;
  206.     kDETAspectMainBitmap        = 5;
  207.     kDETAspectName                = 6;
  208.     kDETAspectCategory            = 7;
  209.     kDETAspectExternalCategory    = 8;
  210.     kDETAspectKind                = 9;
  211.     kDETAspectGender            = 10;
  212.     kDETAspectWhatIs            = 11;
  213.     kDETAspectAliasKind            = 12;
  214.     kDETAspectAliasGender        = 13;
  215.     kDETAspectAliasWhatIs        = 14;
  216.     kDETAspectBalloons            = 15;
  217.     kDETAspectNewMenuName        = 16;
  218.     kDETAspectNewEntryName        = 17;
  219.     kDETAspectNewValue            = 18;
  220.     kDETAspectSublistOpenOnNew    = 19;
  221.     kDETAspectLookup            = 20;
  222.     kDETAspectDragInString        = 21;
  223.     kDETAspectDragInVerb        = 22;
  224.     kDETAspectDragInSummary        = 23;
  225.     kDETAspectRecordDragIn        = 24;
  226.     kDETAspectRecordCatDragIn    = 25;
  227.     kDETAspectAttrDragIn        = 26;
  228.     kDETAspectAttrDragOut        = 27;
  229.     kDETAspectViewMenu            = 28;
  230.     kDETAspectReverseSort        = 29;
  231.     kDETAspectInfoPageCustomWindow = 30;
  232.  
  233. { Properties: }
  234.     kDETNoProperty                = -1;
  235.  
  236. { Each aspect has 250 attribute properties in this range: }
  237.     kDETFirstLocalProperty        = 0;
  238.     kDETLastLocalProperty        = 0+(kDETFirstLocalProperty + 249);
  239.  
  240. { Developers should use property numbers starting at this point: }
  241.     kDETFirstDevProperty        = 40;
  242.  
  243. { The following range provides constant numeric properties for use in patterns and comparisons (constant n is
  244.   
  245.    given by kDETFirstConstantProperty+n): }
  246.     kDETFirstConstantProperty    = 250;
  247.     kDETLastConstantProperty    = 0+(kDETFirstConstantProperty + 249);
  248.  
  249. { To convert a number into a constant property, add this: }
  250.     kDETConstantProperty        = kDETFirstConstantProperty;
  251.     kDETZeroProperty            = 0+(kDETConstantProperty + 0);
  252.     kDETOneProperty                = 0+(kDETConstantProperty + 1);
  253.     kDETFalseProperty            = 0+(kDETConstantProperty + 0);
  254.     kDETTrueProperty            = 0+(kDETConstantProperty + 1);
  255.  
  256. { The following apply to records, attributes, or aliases; they are the name and kind, as they appear in icon lists: }
  257.     kDETPrName                    = 3050;
  258.     kDETPrKind                    = 3051;
  259.  
  260. { Access mask properties: }
  261.     kDETDNodeAccessMask            = 25825;                        { The DNode access mask }
  262.     kDETRecordAccessMask        = 25826;                        { The record access mask }
  263.     kDETAttributeAccessMask        = 25827;                        { The attribute access mask }
  264.     kDETPrimaryMaskByBit        = 25828;                        { A set of sixteen properties to access all bits of the primary mask }
  265.  
  266. { See AOCE documentation for details definitions of each of these bits: }
  267.     kDETPrimarySeeMask            = kDETPrimaryMaskByBit;
  268.     kDETPrimaryAddMask            = 0+(kDETPrimaryMaskByBit + 1);
  269.     kDETPrimaryDeleteMask        = 0+(kDETPrimaryMaskByBit + 2);
  270.     kDETPrimaryChangeMask        = 0+(kDETPrimaryMaskByBit + 3);
  271.     kDETPrimaryRenameMask        = 0+(kDETPrimaryMaskByBit + 4);
  272.     kDETPrimaryChangePrivsMask    = 0+(kDETPrimaryMaskByBit + 5);
  273.     kDETPrimaryTopMaskBit        = 0+(kDETPrimaryMaskByBit + 15);
  274.  
  275. { The following property is zero until we've completed the first catalog lookup; from then on it's 1 }
  276.     kDETPastFirstLookup            = 26550;
  277.  
  278. { The following property is the page number; issuing a property command with this property will flip info-pages }
  279.     kDETInfoPageNumber            = 27050;
  280.  
  281. { The value of the following properties contains the template number of the targeted aspect's template, and the
  282.    currently open info-page (if any). These values can be used with kDETAspectTemplate and kDETInfoPageTemplate
  283.    target selectors. }
  284.     kDETAspectTemplateNumber    = 26551;
  285.     kDETInfoPageTemplateNumber    = 26552;
  286.  
  287. { Properties for property commands to deal with sublist items: }
  288.     kDETOpenSelectedItems        = 26553;                        { Open selected sublist items }
  289.     kDETAddNewItem                = 26554;                        { Add new sublist item }
  290.     kDETRemoveSelectedItems        = 26555;                        { Remove selected sublist items }
  291.  
  292. { Property types are used to specify types of properties and conversions between types (zero and negative numbers
  293.    are reserved for Apple; developer code resources can use positive numbers): }
  294.     kDETPrTypeNumber            = -1;                            { A number }
  295.     kDETPrTypeString            = -2;                            { A string }
  296.     kDETPrTypeBinary            = -3;                            { A binary block }
  297.  
  298. { ************************************ Info-pages }
  299. { Info-pages include the following as well:
  300.  
  301.      Type    Offset                        Description
  302.      ----    ------                        -----------
  303.     'deti'    0                            Identifies the type of resource; see below for details on the contents
  304.     'rstr'    kDETInfoPageName            Is the name of the view to use in the page selection pop-up
  305.     'rstr'    kDETInfoPageMainViewAspect    Is the name of the aspect to use with the main page view
  306.     'rstr'    kDETInfoPageMenuName        Is the name of the catalogs menu ("Catalogs" if not present)
  307.     'detm'    kDETInfoPageMenuEntries        Are menu entries to go in the Catalogs menu
  308.  
  309. }
  310.     kDETInfoPageName            = 4;
  311.     kDETInfoPageMainViewAspect    = 5;
  312.     kDETInfoPageMenuName        = 6;
  313.     kDETInfoPageMenuEntries        = 7;
  314.  
  315. { ************************************ Views 
  316.  
  317.    Flags: }
  318.     kDETNoFlags                    = 0;
  319. { Main view (non-sublist) field enabled }
  320.     kDETEnabled                    = 0+(1 * (2**(0)));
  321.  
  322. { The following flags make sense for items in a sublist only }
  323. { Hilight view when entry is selected }
  324.     kDETHilightIfSelected        = 0+(1 * (2**(0)));
  325.  
  326. { The following flags make sense for text views only }
  327.     kDETNumericOnly                = 0+(1 * (2**(3)));                { Only allow the user to enter digits }
  328.     kDETMultiLine                = 0+(1 * (2**(4)));                { Allow multiple lines in view }
  329.     kDETDynamicSize                = 0+(1 * (2**(9)));                { Don't draw box around text until user clicks in it, then auto-size it
  330.      * Don't allow the user to enter colons (convert ":"s to "-"s) }
  331.     kDETAllowNoColons            = 0+(1 * (2**(10)));
  332.  
  333. { The following flags are used for pop-up menus only }
  334. { Automatically resize pop-up based on contents }
  335.     kDETPopupDynamicSize        = 0+(1 * (2**(8)));
  336.  
  337. { The following flags are used for EditPicture views only }
  338. { Scale picture to view bounds rather than cropping }
  339.     kDETScaleToView                = 0+(1 * (2**(8)));
  340.  
  341. {    Sizes for icons }
  342.     kDETLargeIcon                = 0;
  343.     kDETSmallIcon                = 1;
  344.     kDETMiniIcon                = 2;
  345.  
  346. { Stolen from TextEdit.h }
  347.     kDETLeft                    = 0;
  348.     kDETCenter                    = 1;
  349.     kDETRight                    = -1;
  350.     kDETForceLeft                = -2;
  351.  
  352. { Flags for use within Box view type attributes - these are distinct from the flags above }
  353.     kDETUnused                    = 0;
  354.     kDETBoxTakesContentClicks    = 0+(1 * (2**(0)));
  355.     kDETBoxIsRounded            = 0+(1 * (2**(1)));
  356.     kDETBoxIsGrayed                = 0+(1 * (2**(2)));
  357.     kDETBoxIsInvisible            = 0+(1 * (2**(3)));
  358.  
  359. { The common font info }
  360.     kDETApplicationFont            = 1;
  361.     kDETApplicationFontSize        = 9;
  362.     kDETAppFontLineHeight        = 12;
  363.     kDETSystemFont                = 0;
  364.     kDETSystemFontSize            = 12;
  365.     kDETSystemFontLineHeight    = 16;
  366.     kDETDefaultFont                = 1;
  367.     kDETDefaultFontSize            = 9;
  368.     kDETDefaultFontLineHeight    = 12;
  369.  
  370. {    These were taken from QuickDraw.h (where they're enums and therefore unusable in resource definitions): }
  371.     kDETNormal                    = 0;
  372.     kDETBold                    = 1;
  373.     kDETItalic                    = 2;
  374.     kDETUnderline                = 4;
  375.     kDETOutline                    = 8;
  376.     kDETShadow                    = $10;
  377.     kDETCondense                = $20;
  378.     kDETExtend                    = $40;
  379.  
  380.     kDETIconStyle                = -3;                            { Normal text style for regular sublist entries, italic text style for aliases }
  381.  
  382. { View menu: }
  383.     kDETChangeViewCommand        = 'view';
  384.  
  385. { Info-page window sizes: }
  386. { Default record info-pages: }
  387.     kDETRecordInfoWindHeight    = 228;
  388.     kDETRecordInfoWindWidth        = 400;
  389.  
  390. { Default attribute info-pages: }
  391.     kDETAttributeInfoWindHeight    = 250;
  392.     kDETAttributeInfoWindWidth    = 230;
  393.  
  394. { Page identifying icon (for default info-page layout): }
  395.     kDETSubpageIconTop            = 8;
  396.     kDETSubpageIconLeft            = 8;
  397.     kDETSubpageIconBottom        = 0+(kDETSubpageIconTop + 32);
  398.     kDETSubpageIconRight        = 0+(kDETSubpageIconLeft + 32);
  399.  
  400. { ************************************ Killers 
  401.  
  402.    Killers include the following as well:
  403.  
  404.      Type    Offset                        Description
  405.      ----    ------                        -----------
  406.     'detk'    0                            Identifies the type of resource; see below for details on the contents
  407.     'rst#'    kDETKillerName                Contains a list of template names to be killed
  408.  
  409. }
  410.     kDETKillerName                = 1;
  411.  
  412. { ************************************ Forwarders 
  413.  
  414.    Forwarders include the following as well:
  415.  
  416.      Type    Offset                        Description
  417.      ----    ------                        -----------
  418.     'detf'    0                            Identifies the type of resource; see below for details on the contents
  419.     'rst#'    kDETForwarderTemplateNames    Contains a list of names of templates to forward to
  420.  
  421. }
  422.     kDETForwarderTemplateNames    = 4;
  423.  
  424. { Target specification: }
  425.     kDETSelf                    = 0;                            { The "current" item }
  426.     kDETSelfOtherAspect            = 1;                            { Another aspect of the current item }
  427.     kDETParent                    = 2;                            { The parent (i.e., the aspect we're in the sublist of, if any) of the current item }
  428.     kDETSublistItem                = 3;                            { The itemNumberth item in the sublist }
  429.     kDETSelectedSublistItem        = 4;                            { The itemNumberth selected item in the sublist }
  430.     kDETDSSpec                    = 5;                            { The item specified by the packed DSSpec }
  431.     kDETAspectTemplate            = 6;                            { A specific aspect template (number itemNumber) }
  432.     kDETInfoPageTemplate        = 7;                            { A specific info-page template (number itemNumber)
  433.     *  Force type to be short }
  434.     kDETHighSelector            = $F000;
  435.  
  436.     
  437. TYPE
  438.     DETTargetSelector = LONGINT;
  439.  
  440.     DETTargetSpecification = RECORD
  441.         selector:                DETTargetSelector;                        { Target selection method (see above) }
  442.         aspectName:                RStringPtr;                                { The name of the aspect (kDETSelfOtherAspect, kDETSublistItem,
  443.                                            kDETSelectedSublistItem, kDETDSSpec); nil for main aspect or none;
  444.                                            always filled in for calls if there is an aspect, even if it's the main aspect }
  445.         itemNumber:                LONGINT;                                { Sublist index (kDETSublistItem & kDETSelectedSublistItem & kDETAspectTemplate);
  446.                                            1-based indexing }
  447.         dsSpec:                    PackedDSSpecPtr;                        { DSSpec (kDETDSSpec only) }
  448.     END;
  449.  
  450. { Code resource calls and call-backs both return an OSType:
  451.         kDETDidNotHandle (1)    = used by template to say "I didn't handle it" (for calls only)
  452.         noErr                    = function completed successfully
  453.         any error                = function failed, and here's why
  454. }
  455. {$SETC kDETDidNotHandle := 1}
  456.  
  457. CONST
  458.     kDETcmdSimpleCallback        = 0;
  459.     kDETcmdBeep                    = 1;
  460.     kDETcmdBusy                    = 2;
  461.     kDETcmdChangeCallFors        = 3;
  462.     kDETcmdGetCommandSelectionCount = 4;
  463.     kDETcmdGetCommandItemN        = 5;
  464.     kDETcmdOpenDSSpec            = 6;
  465.     kDETcmdAboutToTalk            = 7;
  466.     kDETcmdUnloadTemplates        = 8;
  467.     kDETcmdTemplateCounts        = 9;
  468.     kDETcmdTargetedCallback        = 1000;
  469.     kDETcmdGetDSSpec            = 1001;
  470.     kDETcmdSublistCount            = 1002;
  471.     kDETcmdSelectedSublistCount    = 1003;
  472.     kDETcmdRequestSync            = 1004;
  473.     kDETcmdBreakAttribute        = 1005;
  474.     kDETcmdGetTemplateFSSpec    = 1006;
  475.     kDETcmdGetOpenEdit            = 1007;
  476.     kDETcmdCloseEdit            = 1008;
  477.     kDETcmdPropertyCallback        = 2000;
  478.     kDETcmdGetPropertyType        = 2001;
  479.     kDETcmdGetPropertyNumber    = 2002;
  480.     kDETcmdGetPropertyRString    = 2003;
  481.     kDETcmdGetPropertyBinarySize = 2004;
  482.     kDETcmdGetPropertyBinary    = 2005;
  483.     kDETcmdGetPropertyChanged    = 2006;
  484.     kDETcmdGetPropertyEditable    = 2007;
  485.     kDETcmdSetPropertyType        = 2008;
  486.     kDETcmdSetPropertyNumber    = 2009;
  487.     kDETcmdSetPropertyRString    = 2010;
  488.     kDETcmdSetPropertyBinary    = 2011;
  489.     kDETcmdSetPropertyChanged    = 2012;
  490.     kDETcmdSetPropertyEditable    = 2013;
  491.     kDETcmdDirtyProperty        = 2014;
  492.     kDETcmdDoPropertyCommand    = 2015;
  493.     kDETcmdAddMenu                = 2016;
  494.     kDETcmdRemoveMenu            = 2017;
  495.     kDETcmdMenuItemRString        = 2018;
  496.     kDETcmdSaveProperty            = 2019;
  497.     kDETcmdGetCustomViewUserReference = 2020;
  498.     kDETcmdGetCustomViewBounds    = 2021;
  499.     kDETcmdGetResource            = 2022;
  500. { Force type to be long }
  501.     kDETcmdHighCallback            = $F0000000;
  502.  
  503.     
  504. TYPE
  505.     DETCallBackFunctions = LONGINT;
  506.  
  507.     DETProtoCallBackBlock = RECORD
  508.         reqFunction:            DETCallBackFunctions;
  509.         target:                    DETTargetSpecification;
  510.         property:                INTEGER;
  511.     END;
  512.  
  513.     DETBeepBlock = RECORD
  514.         reqFunction:            DETCallBackFunctions;
  515.     END;
  516.  
  517.     DETBusyBlock = RECORD
  518.         reqFunction:            DETCallBackFunctions;
  519.     END;
  520.  
  521.     DETChangeCallForsBlock = RECORD
  522.         reqFunction:            DETCallBackFunctions;
  523.         target:                    DETTargetSpecification;
  524.         newCallFors:            LONGINT;                                {  -> New call-for mask }
  525.     END;
  526.  
  527.     DETGetCommandSelectionCountBlock = RECORD
  528.         reqFunction:            DETCallBackFunctions;
  529.         count:                    LONGINT;                                { <-  The number of items in the command selection list }
  530.     END;
  531.  
  532.  
  533. CONST
  534.     kDETHFSType                    = 0;                            { HFS item type }
  535.     kDETDSType                    = 1;                            { Catalog Service item type }
  536.     kDETMailType                = 2;                            { Mail (letter) item type }
  537.     kDETMoverType                = 3;                            { Sounds, fonts, etc., from inside a suitcase or system file }
  538.     kDETLastItemType            = $F0000000;                    { Force it to be a long (C & C++ seem to disagree about the definition of 0xF000) }
  539.  
  540.     
  541. TYPE
  542.     DETItemType = LONGINT;
  543.  
  544. { FSSpec plus possibly interesting additional info }
  545.     DETFSInfo = RECORD
  546.         fileType:                OSType;                                    { File type }
  547.         fileCreator:            OSType;                                    { File creator }
  548.         fdFlags:                INTEGER;                                { Finder flags }
  549.         fsSpec:                    FSSpec;                                    { FSSpec }
  550.     END;
  551.  
  552.     DSRec = RECORD
  553.         dsSpec:                    ^PackedDSSpecPtr;                        { <-  DSSpec for item (caller must DisposHandle() when done) }
  554.         refNum:                    INTEGER;                                { <-  Refnum for returned address }
  555.         identity:                AuthIdentity;                            { <-  Identity for returned address }
  556.     END;
  557.  
  558.     DETFSInfoPtr = ^DETFSInfo;
  559.  
  560.     LetterSpecPtr = ^LetterSpec;
  561.  
  562.     ItemRec = RECORD
  563.         CASE INTEGER OF
  564.         0: (
  565.             fsInfo:                        ^DETFSInfoPtr;                        { <-  FSSpec & info for item (caller must DisposHandle() when done) }
  566.            );
  567.         1: (
  568.             ds:                            DSRec;
  569.            );
  570.         2: (
  571.             dsSpec:                        ^PackedDSSpecPtr;                    { <-  DSSpec for item (caller must DisposHandle() when done) }
  572.            );
  573.         3: (
  574.             ltrSpec:                    ^LetterSpecPtr;                        { <-  Letter spec for item (caller must DisposHandle() when done) }
  575.            );
  576.     END;
  577.  
  578.     DETGetCommandItemNBlock = RECORD
  579.         reqFunction:            DETCallBackFunctions;
  580.         itemNumber:                LONGINT;                                {  -> Item number to retrieve (1-based) }
  581.         itemType:                DETItemType;                            {  -> Type of item to be returned (if we can interpret it as such) }
  582.         item:                    ItemRec;
  583.     END;
  584.  
  585.     DETGetDSSpecBlock = RECORD
  586.         reqFunction:            DETCallBackFunctions;
  587.         target:                    DETTargetSpecification;
  588.         dsSpec:                    ^PackedDSSpecPtr;                        { <-  Handle with result (caller must DisposHandle() when done) }
  589.         refNum:                    INTEGER;                                { <-  Refnum for address if PD }
  590.         identity:                AuthIdentity;                            { <-  Identity for address }
  591.         isAlias:                BOOLEAN;                                { <-  True if this entry is an alias }
  592.         isRecordRef:            BOOLEAN;                                { <-  True if this entry is a record reference (reserved) }
  593.     END;
  594.  
  595.     DETGetTemplateFSSpecBlock = RECORD
  596.         reqFunction:            DETCallBackFunctions;
  597.         target:                    DETTargetSpecification;
  598.         fsSpec:                    FSSpec;                                    { <-  FSSpec of template file }
  599.         baseID:                    INTEGER;                                { <-  Base ID of this template }
  600.         aspectTemplateNumber:    LONGINT;                                { <-  The template number for this aspect template }
  601.     END;
  602.  
  603.     DETGetOpenEditBlock = RECORD
  604.         reqFunction:            DETCallBackFunctions;
  605.         target:                    DETTargetSpecification;
  606.         viewProperty:            INTEGER;                                { <-  The property of the view being edited (or kNoProperty if none) }
  607.     END;
  608.  
  609.     DETCloseEditBlock = RECORD
  610.         reqFunction:            DETCallBackFunctions;
  611.         target:                    DETTargetSpecification;
  612.     END;
  613.  
  614.     DETGetPropertyTypeBlock = RECORD
  615.         reqFunction:            DETCallBackFunctions;
  616.         target:                    DETTargetSpecification;
  617.         property:                INTEGER;
  618.         propertyType:            INTEGER;                                { <-  The type of the property }
  619.     END;
  620.  
  621.     DETGetPropertyNumberBlock = RECORD
  622.         reqFunction:            DETCallBackFunctions;
  623.         target:                    DETTargetSpecification;
  624.         property:                INTEGER;
  625.         propertyValue:            LONGINT;                                { <-  The value of the property }
  626.     END;
  627.  
  628.     DETGetPropertyRStringBlock = RECORD
  629.         reqFunction:            DETCallBackFunctions;
  630.         target:                    DETTargetSpecification;
  631.         property:                INTEGER;
  632.         propertyValue:            RStringHandle;                            { <-  A handle containing the property (as an RString) (caller must DisposHandle() when done) }
  633.     END;
  634.  
  635.     DETGetPropertyBinarySizeBlock = RECORD
  636.         reqFunction:            DETCallBackFunctions;
  637.         target:                    DETTargetSpecification;
  638.         property:                INTEGER;
  639.         propertyBinarySize:        LONGINT;                                { <-  The size of the property as a binary block }
  640.     END;
  641.  
  642.     DETGetPropertyBinaryBlock = RECORD
  643.         reqFunction:            DETCallBackFunctions;
  644.         target:                    DETTargetSpecification;
  645.         property:                INTEGER;
  646.         propertyValue:            Handle;                                    { <-  Handle with the value of the property (caller must DisposHandle() when done) }
  647.     END;
  648.  
  649.     DETGetPropertyChangedBlock = RECORD
  650.         reqFunction:            DETCallBackFunctions;
  651.         target:                    DETTargetSpecification;
  652.         property:                INTEGER;
  653.         propertyChanged:        BOOLEAN;                                { <-  True if the property is marked as changed }
  654.         filler1:                BOOLEAN;
  655.     END;
  656.  
  657.     DETGetPropertyEditableBlock = RECORD
  658.         reqFunction:            DETCallBackFunctions;
  659.         target:                    DETTargetSpecification;
  660.         property:                INTEGER;
  661.         propertyEditable:        BOOLEAN;                                { <-  True if the property can be edited by the user (if false, view will appear disabled) }
  662.         filler1:                BOOLEAN;
  663.     END;
  664.  
  665.     DETSetPropertyTypeBlock = RECORD
  666.         reqFunction:            DETCallBackFunctions;
  667.         target:                    DETTargetSpecification;
  668.         property:                INTEGER;
  669.         newType:                INTEGER;                                {  -> New type for property (just sets type, does not convert contents) }
  670.     END;
  671.  
  672.     DETSetPropertyNumberBlock = RECORD
  673.         reqFunction:            DETCallBackFunctions;
  674.         target:                    DETTargetSpecification;
  675.         property:                INTEGER;
  676.         newValue:                LONGINT;                                {  -> New value to set property to (and set type to number) }
  677.     END;
  678.  
  679.     DETSetPropertyRStringBlock = RECORD
  680.         reqFunction:            DETCallBackFunctions;
  681.         target:                    DETTargetSpecification;
  682.         property:                INTEGER;
  683.         newValue:                RStringPtr;                                {  -> New value to set property to (and set type to RString) }
  684.     END;
  685.  
  686.     DETSetPropertyBinaryBlock = RECORD
  687.         reqFunction:            DETCallBackFunctions;
  688.         target:                    DETTargetSpecification;
  689.         property:                INTEGER;
  690.         newValue:                Ptr;                                    {  -> New value to set property to (and set type to binary) }
  691.         newValueSize:            LONGINT;                                {  -> Size of new value }
  692.     END;
  693.  
  694.     DETSetPropertyChangedBlock = RECORD
  695.         reqFunction:            DETCallBackFunctions;
  696.         target:                    DETTargetSpecification;
  697.         property:                INTEGER;
  698.         propertyChanged:        BOOLEAN;                                {  -> Value to set changed flag on property to }
  699.         filler1:                BOOLEAN;
  700.     END;
  701.  
  702.     DETSetPropertyEditableBlock = RECORD
  703.         reqFunction:            DETCallBackFunctions;
  704.         target:                    DETTargetSpecification;
  705.         property:                INTEGER;
  706.         propertyEditable:        BOOLEAN;                                {  -> Value to set editable flag on property to }
  707.         filler1:                BOOLEAN;
  708.     END;
  709.  
  710.     DETDirtyPropertyBlock = RECORD
  711.         reqFunction:            DETCallBackFunctions;
  712.         target:                    DETTargetSpecification;
  713.         property:                INTEGER;
  714.     END;
  715.  
  716.     DETDoPropertyCommandBlock = RECORD
  717.         reqFunction:            DETCallBackFunctions;
  718.         target:                    DETTargetSpecification;
  719.         property:                INTEGER;
  720.         parameter:                LONGINT;                                { ->  Parameter of command }
  721.     END;
  722.  
  723.     DETSublistCountBlock = RECORD
  724.         reqFunction:            DETCallBackFunctions;
  725.         target:                    DETTargetSpecification;
  726.         count:                    LONGINT;                                { <-  The number of items in the current item's sublist }
  727.     END;
  728.  
  729.     DETSelectedSublistCountBlock = RECORD
  730.         reqFunction:            DETCallBackFunctions;
  731.         target:                    DETTargetSpecification;
  732.         count:                    LONGINT;                                { <-  The number of selected items in the current item's sublist }
  733.     END;
  734.  
  735.     DETRequestSyncBlock = RECORD
  736.         reqFunction:            DETCallBackFunctions;
  737.         target:                    DETTargetSpecification;
  738.     END;
  739.  
  740.     DETAddMenuBlock = RECORD
  741.         reqFunction:            DETCallBackFunctions;
  742.         target:                    DETTargetSpecification;
  743.         property:                INTEGER;
  744.         name:                    ^RString;                                {  -> Name of new menu item }
  745.         parameter:                LONGINT;                                {  -> Parameter to return when this item is selected }
  746.         addAfter:                LONGINT;                                {  -> Parameter of entry to add after, or -1 for add at end }
  747.     END;
  748.  
  749.     DETRemoveMenuBlock = RECORD
  750.         reqFunction:            DETCallBackFunctions;
  751.         target:                    DETTargetSpecification;
  752.         property:                INTEGER;
  753.         itemToRemove:            LONGINT;                                {  -> Parameter of menu item to remove }
  754.     END;
  755.  
  756.     DETMenuItemRStringBlock = RECORD
  757.         reqFunction:            DETCallBackFunctions;
  758.         target:                    DETTargetSpecification;
  759.         property:                INTEGER;
  760.         itemParameter:            LONGINT;                                {  -> Parameter of menu item to return string for }
  761.         rString:                RStringHandle;                            { <-  Handle with the RString (caller must DisposHandle() when done) }
  762.     END;
  763.  
  764.     DETOpenDSSpecBlock = RECORD
  765.         reqFunction:            DETCallBackFunctions;
  766.         dsSpec:                    PackedDSSpecPtr;                        {  -> DSSpec of object to be opened }
  767.     END;
  768.  
  769.     DETAboutToTalkBlock = RECORD
  770.         reqFunction:            DETCallBackFunctions;
  771.     END;
  772.  
  773.     DETBreakAttributeBlock = RECORD
  774.         reqFunction:            DETCallBackFunctions;
  775.         target:                    DETTargetSpecification;
  776.         breakAttribute:            AttributePtr;                            {  -> Attribute to parse }
  777.         isChangeable:            BOOLEAN;                                {  -> True if the value can be changed by the user }
  778.         filler1:                BOOLEAN;
  779.     END;
  780.  
  781.     DETSavePropertyBlock = RECORD
  782.         reqFunction:            DETCallBackFunctions;
  783.         target:                    DETTargetSpecification;
  784.         property:                INTEGER;
  785.     END;
  786.  
  787.     DETGetCustomViewUserReferenceBlock = RECORD
  788.         reqFunction:            DETCallBackFunctions;
  789.         target:                    DETTargetSpecification;
  790.         property:                INTEGER;
  791.         userReference:            INTEGER;                                { <-  User reference value, as specified in the .r file }
  792.     END;
  793.  
  794.     DETGetCustomViewBoundsBlock = RECORD
  795.         reqFunction:            DETCallBackFunctions;
  796.         target:                    DETTargetSpecification;
  797.         property:                INTEGER;
  798.         bounds:                    Rect;                                    { <-  Bounds of the view }
  799.     END;
  800.  
  801.     DETGetResourceBlock = RECORD
  802.         reqFunction:            DETCallBackFunctions;
  803.         target:                    DETTargetSpecification;
  804.         property:                INTEGER;
  805.         resourceType:            ResType;                                {  -> Resource type }
  806.         theResource:            Handle;                                    { <-  The resource handle (caller must dispose when done) }
  807.     END;
  808.  
  809.     DETTemplateCounts = RECORD
  810.         reqFunction:            DETCallBackFunctions;
  811.         aspectTemplateCount:    LONGINT;                                { <-  Number of aspect templates in the system }
  812.         infoPageTemplateCount:    LONGINT;                                { <-  Number of info-page templates in the system }
  813.     END;
  814.  
  815.     DETUnloadTemplatesBlock = RECORD
  816.         reqFunction:            DETCallBackFunctions;
  817.     END;
  818.  
  819.     DETCallBackBlock = RECORD
  820.         CASE INTEGER OF
  821.         0: (
  822.             protoCallBack:                DETProtoCallBackBlock;
  823.            );
  824.         1: (
  825.             beep:                        DETBeepBlock;
  826.            );
  827.         2: (
  828.             busy:                        DETBusyBlock;
  829.            );
  830.         3: (
  831.             changeCallFors:                DETChangeCallForsBlock;
  832.            );
  833.         4: (
  834.             getCommandSelectionCount:    DETGetCommandSelectionCountBlock;
  835.            );
  836.         5: (
  837.             getCommandItemN:            DETGetCommandItemNBlock;
  838.            );
  839.         6: (
  840.             getDSSpec:                    DETGetDSSpecBlock;
  841.            );
  842.         7: (
  843.             getTemplateFSSpec:            DETGetTemplateFSSpecBlock;
  844.            );
  845.         8: (
  846.             getOpenEdit:                DETGetOpenEditBlock;
  847.            );
  848.         9: (
  849.             closeEdit:                    DETCloseEditBlock;
  850.            );
  851.         10: (
  852.             getPropertyType:            DETGetPropertyTypeBlock;
  853.            );
  854.         11: (
  855.             getPropertyNumber:            DETGetPropertyNumberBlock;
  856.            );
  857.         12: (
  858.             getPropertyRString:            DETGetPropertyRStringBlock;
  859.            );
  860.         13: (
  861.             getPropertyBinarySize:        DETGetPropertyBinarySizeBlock;
  862.            );
  863.         14: (
  864.             getPropertyBinary:            DETGetPropertyBinaryBlock;
  865.            );
  866.         15: (
  867.             getPropertyChanged:            DETGetPropertyChangedBlock;
  868.            );
  869.         16: (
  870.             getPropertyEditable:        DETGetPropertyEditableBlock;
  871.            );
  872.         17: (
  873.             setPropertyType:            DETSetPropertyTypeBlock;
  874.            );
  875.         18: (
  876.             setPropertyNumber:            DETSetPropertyNumberBlock;
  877.            );
  878.         19: (
  879.             setPropertyRString:            DETSetPropertyRStringBlock;
  880.            );
  881.         20: (
  882.             setPropertyBinary:            DETSetPropertyBinaryBlock;
  883.            );
  884.         21: (
  885.             setPropertyChanged:            DETSetPropertyChangedBlock;
  886.            );
  887.         22: (
  888.             setPropertyEditable:        DETSetPropertyEditableBlock;
  889.            );
  890.         23: (
  891.             dirtyProperty:                DETDirtyPropertyBlock;
  892.            );
  893.         24: (
  894.             doPropertyCommand:            DETDoPropertyCommandBlock;
  895.            );
  896.         25: (
  897.             sublistCount:                DETSublistCountBlock;
  898.            );
  899.         26: (
  900.             selectedSublistCount:        DETSelectedSublistCountBlock;
  901.            );
  902.         27: (
  903.             requestSync:                DETRequestSyncBlock;
  904.            );
  905.         28: (
  906.             addMenu:                    DETAddMenuBlock;
  907.            );
  908.         29: (
  909.             removeMenu:                    DETRemoveMenuBlock;
  910.            );
  911.         30: (
  912.             menuItemRString:            DETMenuItemRStringBlock;
  913.            );
  914.         31: (
  915.             openDSSpec:                    DETOpenDSSpecBlock;
  916.            );
  917.         32: (
  918.             aboutToTalk:                DETAboutToTalkBlock;
  919.            );
  920.         33: (
  921.             breakAttribute:                DETBreakAttributeBlock;
  922.            );
  923.         34: (
  924.             saveProperty:                DETSavePropertyBlock;
  925.            );
  926.         35: (
  927.             getCustomViewUserReference:    DETGetCustomViewUserReferenceBlock;
  928.            );
  929.         36: (
  930.             getCustomViewBounds:        DETGetCustomViewBoundsBlock;
  931.            );
  932.         37: (
  933.             getResource:                DETGetResourceBlock;
  934.            );
  935.         38: (
  936.             templateCounts:                DETTemplateCounts;
  937.            );
  938.         39: (
  939.             unloadTemplates:            DETUnloadTemplatesBlock;
  940.            );
  941.     END;
  942.  
  943.     DETCallBackBlockPtr = ^DETCallBackBlock;
  944.  
  945.     DETCallBackProcPtr = ProcPtr;  { FUNCTION DETCallBack(VAR callBlockPtr: DETCallBlock; callBackBlockPtr: DETCallBackBlockPtr): OSErr; }
  946.     DETCallBackUPP = UniversalProcPtr;
  947.  
  948.     DETCallBack = DETCallBackUPP;
  949.  
  950. { Call functions:
  951.  
  952.         reqFunction                        Action
  953.         -----------                        ------
  954.         kDETcmdInit                        Called once when template is first loaded (good time to allocate private data); returns call-for list
  955.         kDETcmdExit                        Called once when template is freed (good time to free private data)
  956.  
  957.         kDETcmdAttributeCreation        New sublist attribute creation about to occur; this gives the template a chance to modify
  958.                                         the value that's about to be created; sent to the template that will be used for
  959.                                         the main aspect of the new entry
  960.  
  961.         kDETcmdDynamicForwarders        Return a list of dynamically created forwarders
  962.  
  963.         kDETcmdInstanceInit                Called once when instance of template is started (good time to allocate private instance data)
  964.         kDETcmdInstanceExit                Called once when instance is ended (good time to free private instance data)
  965.  
  966.         kDETcmdIdle                        Called periodically during idle times
  967.  
  968.         kDETcmdViewListChanged            Called when the info-page view-list (list of enabled views) has changed
  969.  
  970.         kDETcmdValidateSave                Validate save: about to save info-page, return noErr (or kDETDidNotHandle) if it's OK to do so
  971.  
  972.         kDETcmdDropQuery                Drop query: return the appropriate operation for this drag; ask destination
  973.         kDETcmdDropMeQuery                Drop query: return the appropriate operation for this drag; ask dropee
  974.  
  975.         kDETcmdAttributeNew                Attribute value new (return kDETDidNotHandle to let normal new processing occur)
  976.         kDETcmdAttributeChange            Attribute value change (return kDETDidNotHandle to let normal change processing occur)
  977.         kDETcmdAttributeDelete            Attribute value delete (return kDETDidNotHandle to let normal deletion occur); sent to the
  978.                                         main aspect of the attribute that's about to be deleted
  979.         kDETcmdItemNew                    Target item (record or attribute) has just been created
  980.  
  981.         kDETcmdOpenSelf                    Self open (return noErr to prevent opening; return kDETDidNotHandle to allow it)
  982.  
  983.         kDETcmdDynamicResource            Return a dynamically created resource
  984.  
  985.         kDETcmdShouldSync                Check if the code resource wants to force a sync (update data from catalog)
  986.         kDETcmdDoSync                    Give code resource a chance to sync (read in and break all attributes)
  987.  
  988.         kDETcmdPropertyCommand            Command received in the property number range (usually means a button's been pushed)
  989.  
  990.         kDETcmdMaximumTextLength        Return maximum size for text form of property
  991.  
  992.         kDETcmdPropertyDirtied            Property dirtied, need to redraw
  993.  
  994.         kDETcmdPatternIn                Custom pattern element encountered on reading in an attribute
  995.         kDETcmdPatternOut                Custom pattern element encountered on writing out an attribute
  996.  
  997.         kDETcmdConvertToNumber            Convert from template-defined property type to number
  998.         kDETcmdConvertToRString            Convert from template-defined property type to RString
  999.         kDETcmdConvertFromNumber        Convert from number to template-defined property type
  1000.         kDETcmdConvertFromRString        Convert from RString to template-defined property type
  1001.  
  1002.         kDETcmdCustomViewDraw            Custom view draw
  1003.         kDETcmdCustomViewMouseDown        Custom view mouse down
  1004.  
  1005.         kDETcmdKeyPress                    Key press (used primarily to filter entry into EditText views)
  1006.         kDETcmdPaste                    Paste (used primarily to filter entry into EditText views)
  1007.  
  1008.         kDETcmdCustomMenuSelected        Custom Catalogs menu selected
  1009.         kDETcmdCustomMenuEnabled        Return whether custom Catalogs menu entry should be enabled
  1010. }
  1011.  
  1012. CONST
  1013.     kDETcmdSimpleCall            = 0;
  1014.     kDETcmdInit                    = 1;
  1015.     kDETcmdExit                    = 2;
  1016.     kDETcmdAttributeCreation    = 3;
  1017.     kDETcmdDynamicForwarders    = 4;
  1018.     kDETcmdTargetedCall            = 1000;
  1019.     kDETcmdInstanceInit            = 1001;
  1020.     kDETcmdInstanceExit            = 1002;
  1021.     kDETcmdIdle                    = 1003;
  1022.     kDETcmdViewListChanged        = 1004;
  1023.     kDETcmdValidateSave            = 1005;
  1024.     kDETcmdDropQuery            = 1006;
  1025.     kDETcmdDropMeQuery            = 1007;
  1026.     kDETcmdAttributeNew            = 1008;
  1027.     kDETcmdAttributeChange        = 1009;
  1028.     kDETcmdAttributeDelete        = 1010;
  1029.     kDETcmdItemNew                = 1011;
  1030.     kDETcmdOpenSelf                = 1012;
  1031.     kDETcmdDynamicResource        = 1013;
  1032.     kDETcmdShouldSync            = 1014;
  1033.     kDETcmdDoSync                = 1015;
  1034.     kDETcmdPropertyCall            = 2000;
  1035.     kDETcmdPropertyCommand        = 2001;
  1036.     kDETcmdMaximumTextLength    = 2002;
  1037.     kDETcmdPropertyDirtied        = 2003;
  1038.     kDETcmdPatternIn            = 2004;
  1039.     kDETcmdPatternOut            = 2005;
  1040.     kDETcmdConvertToNumber        = 2006;
  1041.     kDETcmdConvertToRString        = 2007;
  1042.     kDETcmdConvertFromNumber    = 2008;
  1043.     kDETcmdConvertFromRString    = 2009;
  1044.     kDETcmdCustomViewDraw        = 2010;
  1045.     kDETcmdCustomViewMouseDown    = 2011;
  1046.     kDETcmdKeyPress                = 2012;
  1047.     kDETcmdPaste                = 2013;
  1048.     kDETcmdCustomMenuSelected    = 2014;
  1049.     kDETcmdCustomMenuEnabled    = 2015;
  1050.     kDETcmdHighCall                = $F0000000;                    { Force the type to be long }
  1051.  
  1052.     
  1053. TYPE
  1054.     DETCallFunctions = LONGINT;
  1055.  
  1056.     DETProtoCallBlock = RECORD
  1057.         reqFunction:            DETCallFunctions;
  1058.         callBack:                DETCallBack;
  1059.         callBackPrivate:        LONGINT;
  1060.         templatePrivate:        LONGINT;
  1061.         instancePrivate:        LONGINT;
  1062.         target:                    DETTargetSpecification;
  1063.         targetIsMainAspect:        BOOLEAN;
  1064.         filler1:                BOOLEAN;
  1065.         property:                INTEGER;
  1066.     END;
  1067.  
  1068.     DETInitBlock = RECORD
  1069.         reqFunction:            DETCallFunctions;
  1070.         callBack:                DETCallBack;
  1071.         callBackPrivate:        LONGINT;
  1072.         templatePrivate:        LONGINT;
  1073.         newCallFors:            LONGINT;                                { <-  New call-for mask }
  1074.     END;
  1075.  
  1076.     DETExitBlock = RECORD
  1077.         reqFunction:            DETCallFunctions;
  1078.         callBack:                DETCallBack;
  1079.         callBackPrivate:        LONGINT;
  1080.         templatePrivate:        LONGINT;
  1081.     END;
  1082.  
  1083.     DETInstanceInitBlock = RECORD
  1084.         reqFunction:            DETCallFunctions;
  1085.         callBack:                DETCallBack;
  1086.         callBackPrivate:        LONGINT;
  1087.         templatePrivate:        LONGINT;
  1088.         instancePrivate:        LONGINT;
  1089.         target:                    DETTargetSpecification;
  1090.         targetIsMainAspect:        BOOLEAN;
  1091.         filler1:                BOOLEAN;
  1092.     END;
  1093.  
  1094.     DETInstanceExitBlock = RECORD
  1095.         reqFunction:            DETCallFunctions;
  1096.         callBack:                DETCallBack;
  1097.         callBackPrivate:        LONGINT;
  1098.         templatePrivate:        LONGINT;
  1099.         instancePrivate:        LONGINT;
  1100.         target:                    DETTargetSpecification;
  1101.         targetIsMainAspect:        BOOLEAN;
  1102.         filler1:                BOOLEAN;
  1103.     END;
  1104.  
  1105.     DETInstanceIdleBlock = RECORD
  1106.         reqFunction:            DETCallFunctions;
  1107.         callBack:                DETCallBack;
  1108.         callBackPrivate:        LONGINT;
  1109.         templatePrivate:        LONGINT;
  1110.         instancePrivate:        LONGINT;
  1111.         target:                    DETTargetSpecification;
  1112.         targetIsMainAspect:        BOOLEAN;
  1113.         filler1:                BOOLEAN;
  1114.     END;
  1115.  
  1116.     DETPropertyCommandBlock = RECORD
  1117.         reqFunction:            DETCallFunctions;
  1118.         callBack:                DETCallBack;
  1119.         callBackPrivate:        LONGINT;
  1120.         templatePrivate:        LONGINT;
  1121.         instancePrivate:        LONGINT;
  1122.         target:                    DETTargetSpecification;
  1123.         targetIsMainAspect:        BOOLEAN;
  1124.         filler1:                BOOLEAN;
  1125.         property:                INTEGER;
  1126.         parameter:                LONGINT;                                {  -> Parameter of command }
  1127.     END;
  1128.  
  1129.     DETMaximumTextLengthBlock = RECORD
  1130.         reqFunction:            DETCallFunctions;
  1131.         callBack:                DETCallBack;
  1132.         callBackPrivate:        LONGINT;
  1133.         templatePrivate:        LONGINT;
  1134.         instancePrivate:        LONGINT;
  1135.         target:                    DETTargetSpecification;
  1136.         targetIsMainAspect:        BOOLEAN;
  1137.         filler1:                BOOLEAN;
  1138.         property:                INTEGER;
  1139.         maxSize:                LONGINT;                                { <-  Return the maximum number of characters the user can entry when property is edited in an EditText }
  1140.     END;
  1141.  
  1142.     DETViewListChangedBlock = RECORD
  1143.         reqFunction:            DETCallFunctions;
  1144.         callBack:                DETCallBack;
  1145.         callBackPrivate:        LONGINT;
  1146.         templatePrivate:        LONGINT;
  1147.         instancePrivate:        LONGINT;
  1148.         target:                    DETTargetSpecification;
  1149.         targetIsMainAspect:        BOOLEAN;
  1150.         filler1:                BOOLEAN;
  1151.     END;
  1152.  
  1153.     DETPropertyDirtiedBlock = RECORD
  1154.         reqFunction:            DETCallFunctions;
  1155.         callBack:                DETCallBack;
  1156.         callBackPrivate:        LONGINT;
  1157.         templatePrivate:        LONGINT;
  1158.         instancePrivate:        LONGINT;
  1159.         target:                    DETTargetSpecification;
  1160.         targetIsMainAspect:        BOOLEAN;
  1161.         filler1:                BOOLEAN;
  1162.         property:                INTEGER;
  1163.     END;
  1164.  
  1165.     DETValidateSaveBlock = RECORD
  1166.         reqFunction:            DETCallFunctions;
  1167.         callBack:                DETCallBack;
  1168.         callBackPrivate:        LONGINT;
  1169.         templatePrivate:        LONGINT;
  1170.         instancePrivate:        LONGINT;
  1171.         target:                    DETTargetSpecification;
  1172.         targetIsMainAspect:        BOOLEAN;
  1173.         filler1:                BOOLEAN;
  1174.         errorString:            RStringHandle;                            { <-  Handle with error string if validation fails (callee must allocate handle, DE will DisposHandle() it) }
  1175.     END;
  1176.  
  1177. { Valid commandIDs for DETDropQueryBlock and DETDropMeQueryBlock (in addition to property numbers): }
  1178.  
  1179. CONST
  1180.     kDETDoNothing                = 'xxx0';
  1181.     kDETMove                    = 'move';
  1182.     kDETDrag                    = 'drag';
  1183.     kDETAlias                    = 'alis';
  1184.  
  1185.  
  1186. TYPE
  1187.     DETDropQueryBlock = RECORD
  1188.         reqFunction:            DETCallFunctions;
  1189.         callBack:                DETCallBack;
  1190.         callBackPrivate:        LONGINT;
  1191.         templatePrivate:        LONGINT;
  1192.         instancePrivate:        LONGINT;
  1193.         target:                    DETTargetSpecification;
  1194.         targetIsMainAspect:        BOOLEAN;
  1195.         filler1:                BOOLEAN;
  1196.         modifiers:                INTEGER;                                {  -> Modifiers at drop time (option/control/command/shift keys) }
  1197.         commandID:                LONGINT;                                { <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) }
  1198.         destinationType:        AttributeType;                            { <-> Type to convert attribute to }
  1199.         copyToHFS:                BOOLEAN;                                { <-  If true, object should be copied to HFS before being operated on, and deleted after }
  1200.         filler2:                BOOLEAN;
  1201.     END;
  1202.  
  1203.     DETDropMeQueryBlock = RECORD
  1204.         reqFunction:            DETCallFunctions;
  1205.         callBack:                DETCallBack;
  1206.         callBackPrivate:        LONGINT;
  1207.         templatePrivate:        LONGINT;
  1208.         instancePrivate:        LONGINT;
  1209.         target:                    DETTargetSpecification;
  1210.         targetIsMainAspect:        BOOLEAN;
  1211.         filler1:                BOOLEAN;
  1212.         modifiers:                INTEGER;                                {  -> Modifiers at drop time (option/control/command/shift keys) }
  1213.         commandID:                LONGINT;                                { <-> Command ID (kDETDoNothing, kDETMove, kDETDrag (copy), kDETAlias, or a property number) }
  1214.         destinationType:        AttributeType;                            { <-> Type to convert attribute to }
  1215.         copyToHFS:                BOOLEAN;                                { <-  If true, object should be copied to HFS before being operated on, and deleted after }
  1216.         filler2:                BOOLEAN;
  1217.     END;
  1218.  
  1219.     DETAttributeCreationBlock = RECORD
  1220.         reqFunction:            DETCallFunctions;
  1221.         callBack:                DETCallBack;
  1222.         callBackPrivate:        LONGINT;
  1223.         templatePrivate:        LONGINT;
  1224.         parent:                    PackedDSSpecPtr;                        {  -> The object within which the creation will occur }
  1225.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1226.         identity:                AuthIdentity;                            {  -> The identity we're browsing as in the parent object }
  1227.         attrType:                AttributeType;                            { <-> The type of the attribute being created }
  1228.         attrTag:                AttributeTag;                            { <-> The tag of the attribute being created }
  1229.         value:                    Handle;                                    { <-> The value to write (pre-allocated, resize as needed) }
  1230.     END;
  1231.  
  1232.     DETAttributeNewBlock = RECORD
  1233.         reqFunction:            DETCallFunctions;
  1234.         callBack:                DETCallBack;
  1235.         callBackPrivate:        LONGINT;
  1236.         templatePrivate:        LONGINT;
  1237.         instancePrivate:        LONGINT;
  1238.         target:                    DETTargetSpecification;
  1239.         targetIsMainAspect:        BOOLEAN;
  1240.         filler1:                BOOLEAN;
  1241.         parent:                    PackedDSSpecPtr;                        {  -> The object within which the creation will occur }
  1242.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1243.         identity:                AuthIdentity;                            {  -> The identity we're browsing as in the parent object }
  1244.         attrType:                AttributeType;                            { <-> The type of the attribute being created }
  1245.         attrTag:                AttributeTag;                            { <-> The tag of the attribute being created }
  1246.         value:                    Handle;                                    { <-> The value to write (pre-allocated, resize as needed) }
  1247.     END;
  1248.  
  1249.     DETAttributeChangeBlock = RECORD
  1250.         reqFunction:            DETCallFunctions;
  1251.         callBack:                DETCallBack;
  1252.         callBackPrivate:        LONGINT;
  1253.         templatePrivate:        LONGINT;
  1254.         instancePrivate:        LONGINT;
  1255.         target:                    DETTargetSpecification;
  1256.         targetIsMainAspect:        BOOLEAN;
  1257.         filler1:                BOOLEAN;
  1258.         parent:                    PackedDSSpecPtr;                        {  -> The object within which the creation will occur }
  1259.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1260.         identity:                AuthIdentity;                            {  -> The identity we're browsing as in the parent object }
  1261.         attrType:                AttributeType;                            { <-> The type of the attribute being changed }
  1262.         attrTag:                AttributeTag;                            { <-> The tag of the attribute being changed }
  1263.         attrCID:                AttributeCreationID;                    { <-> The CID of the attribute being changed }
  1264.         value:                    Handle;                                    { <-> The value to write (pre-allocated, resize as needed) }
  1265.     END;
  1266.  
  1267.     DETAttributeDeleteBlock = RECORD
  1268.         reqFunction:            DETCallFunctions;
  1269.         callBack:                DETCallBack;
  1270.         callBackPrivate:        LONGINT;
  1271.         templatePrivate:        LONGINT;
  1272.         instancePrivate:        LONGINT;
  1273.         target:                    DETTargetSpecification;
  1274.         targetIsMainAspect:        BOOLEAN;
  1275.         filler1:                BOOLEAN;
  1276.         dsSpec:                    PackedDSSpecPtr;                        {  -> The object which will be deleted }
  1277.         refNum:                    INTEGER;                                {  -> Refnum for returned address (DSSpecs in PDs only) }
  1278.         identity:                AuthIdentity;                            {  -> The identity we're browsing as }
  1279.     END;
  1280.  
  1281.     DETItemNewBlock = RECORD
  1282.         reqFunction:            DETCallFunctions;
  1283.         callBack:                DETCallBack;
  1284.         callBackPrivate:        LONGINT;
  1285.         templatePrivate:        LONGINT;
  1286.         instancePrivate:        LONGINT;
  1287.         target:                    DETTargetSpecification;
  1288.         targetIsMainAspect:        BOOLEAN;
  1289.         filler1:                BOOLEAN;
  1290.     END;
  1291.  
  1292.     DETShouldSyncBlock = RECORD
  1293.         reqFunction:            DETCallFunctions;
  1294.         callBack:                DETCallBack;
  1295.         callBackPrivate:        LONGINT;
  1296.         templatePrivate:        LONGINT;
  1297.         instancePrivate:        LONGINT;
  1298.         target:                    DETTargetSpecification;
  1299.         targetIsMainAspect:        BOOLEAN;
  1300.         filler1:                BOOLEAN;
  1301.         shouldSync:                BOOLEAN;                                { <-  True if we should now sync with catalog }
  1302.         filler2:                BOOLEAN;
  1303.     END;
  1304.  
  1305.     DETDoSyncBlock = RECORD
  1306.         reqFunction:            DETCallFunctions;
  1307.         callBack:                DETCallBack;
  1308.         callBackPrivate:        LONGINT;
  1309.         templatePrivate:        LONGINT;
  1310.         instancePrivate:        LONGINT;
  1311.         target:                    DETTargetSpecification;
  1312.         targetIsMainAspect:        BOOLEAN;
  1313.         filler1:                BOOLEAN;
  1314.     END;
  1315.  
  1316.     DETPatternInBlock = RECORD
  1317.         reqFunction:            DETCallFunctions;
  1318.         callBack:                DETCallBack;
  1319.         callBackPrivate:        LONGINT;
  1320.         templatePrivate:        LONGINT;
  1321.         instancePrivate:        LONGINT;
  1322.         target:                    DETTargetSpecification;
  1323.         targetIsMainAspect:        BOOLEAN;
  1324.         filler1:                BOOLEAN;
  1325.         property:                INTEGER;
  1326.         elementType:            LONGINT;                                {  -> Element type from pattern }
  1327.         extra:                    LONGINT;                                {  -> Extra field from pattern }
  1328.         attribute:                AttributePtr;                            {  -> The complete attribute }
  1329.         dataOffset:                LONGINT;                                { <-> Offset to current (next) byte }
  1330.         bitOffset:                INTEGER;                                { <-> Bit offset (next bit is *fData >> fBitOffset++) }
  1331.     END;
  1332.  
  1333.     DETPatternOutBlock = RECORD
  1334.         reqFunction:            DETCallFunctions;
  1335.         callBack:                DETCallBack;
  1336.         callBackPrivate:        LONGINT;
  1337.         templatePrivate:        LONGINT;
  1338.         instancePrivate:        LONGINT;
  1339.         target:                    DETTargetSpecification;
  1340.         targetIsMainAspect:        BOOLEAN;
  1341.         filler1:                BOOLEAN;
  1342.         property:                INTEGER;
  1343.         elementType:            LONGINT;                                {  -> Element type from pattern }
  1344.         extra:                    LONGINT;                                {  -> Extra field from pattern }
  1345.         attribute:                AttributePtr;                            {  -> The attribute (minus the data portion) }
  1346.         data:                    Handle;                                    {  -> Data to be written (pre-allocated, resize and add at end) }
  1347.         dataOffset:                LONGINT;                                { <-> Offset to next byte to write }
  1348.         bitOffset:                INTEGER;                                { <-> Bit offset (if zero, handle will need to be resized to one more byte before write) }
  1349.     END;
  1350.  
  1351.     DETOpenSelfBlock = RECORD
  1352.         reqFunction:            DETCallFunctions;
  1353.         callBack:                DETCallBack;
  1354.         callBackPrivate:        LONGINT;
  1355.         templatePrivate:        LONGINT;
  1356.         instancePrivate:        LONGINT;
  1357.         target:                    DETTargetSpecification;
  1358.         targetIsMainAspect:        BOOLEAN;
  1359.         filler1:                BOOLEAN;
  1360.         modifiers:                INTEGER;                                {  -> Modifiers at open time (option/control/command/shift keys) }
  1361.     END;
  1362.  
  1363.     DETConvertToNumberBlock = RECORD
  1364.         reqFunction:            DETCallFunctions;
  1365.         callBack:                DETCallBack;
  1366.         callBackPrivate:        LONGINT;
  1367.         templatePrivate:        LONGINT;
  1368.         instancePrivate:        LONGINT;
  1369.         target:                    DETTargetSpecification;
  1370.         targetIsMainAspect:        BOOLEAN;
  1371.         filler1:                BOOLEAN;
  1372.         property:                INTEGER;
  1373.         theValue:                LONGINT;                                { <-  The converted value to return }
  1374.     END;
  1375.  
  1376.     DETConvertToRStringBlock = RECORD
  1377.         reqFunction:            DETCallFunctions;
  1378.         callBack:                DETCallBack;
  1379.         callBackPrivate:        LONGINT;
  1380.         templatePrivate:        LONGINT;
  1381.         instancePrivate:        LONGINT;
  1382.         target:                    DETTargetSpecification;
  1383.         targetIsMainAspect:        BOOLEAN;
  1384.         filler1:                BOOLEAN;
  1385.         property:                INTEGER;
  1386.         theValue:                RStringHandle;                            { <-  A handle with the converted value (callee must allocate handle, DE will DisposHandle() it) }
  1387.     END;
  1388.  
  1389.     DETConvertFromNumberBlock = RECORD
  1390.         reqFunction:            DETCallFunctions;
  1391.         callBack:                DETCallBack;
  1392.         callBackPrivate:        LONGINT;
  1393.         templatePrivate:        LONGINT;
  1394.         instancePrivate:        LONGINT;
  1395.         target:                    DETTargetSpecification;
  1396.         targetIsMainAspect:        BOOLEAN;
  1397.         filler1:                BOOLEAN;
  1398.         property:                INTEGER;
  1399.         theValue:                LONGINT;                                {  -> The value to convert (result should be written direct to the property) }
  1400.     END;
  1401.  
  1402.     DETConvertFromRStringBlock = RECORD
  1403.         reqFunction:            DETCallFunctions;
  1404.         callBack:                DETCallBack;
  1405.         callBackPrivate:        LONGINT;
  1406.         templatePrivate:        LONGINT;
  1407.         instancePrivate:        LONGINT;
  1408.         target:                    DETTargetSpecification;
  1409.         targetIsMainAspect:        BOOLEAN;
  1410.         filler1:                BOOLEAN;
  1411.         property:                INTEGER;
  1412.         theValue:                RStringPtr;                                {  -> The value to convert (result should be written direct to the property) }
  1413.     END;
  1414.  
  1415.     DETCustomViewDrawBlock = RECORD
  1416.         reqFunction:            DETCallFunctions;
  1417.         callBack:                DETCallBack;
  1418.         callBackPrivate:        LONGINT;
  1419.         templatePrivate:        LONGINT;
  1420.         instancePrivate:        LONGINT;
  1421.         target:                    DETTargetSpecification;
  1422.         targetIsMainAspect:        BOOLEAN;
  1423.         filler1:                BOOLEAN;
  1424.         property:                INTEGER;
  1425.     END;
  1426.  
  1427.     DETCustomViewMouseDownBlock = RECORD
  1428.         reqFunction:            DETCallFunctions;
  1429.         callBack:                DETCallBack;
  1430.         callBackPrivate:        LONGINT;
  1431.         templatePrivate:        LONGINT;
  1432.         instancePrivate:        LONGINT;
  1433.         target:                    DETTargetSpecification;
  1434.         targetIsMainAspect:        BOOLEAN;
  1435.         filler1:                BOOLEAN;
  1436.         property:                INTEGER;
  1437.         theEvent:                ^EventRecord;                            {  -> The original event record of the mouse-down }
  1438.     END;
  1439.  
  1440.     DETKeyPressBlock = RECORD
  1441.         reqFunction:            DETCallFunctions;
  1442.         callBack:                DETCallBack;
  1443.         callBackPrivate:        LONGINT;
  1444.         templatePrivate:        LONGINT;
  1445.         instancePrivate:        LONGINT;
  1446.         target:                    DETTargetSpecification;
  1447.         targetIsMainAspect:        BOOLEAN;
  1448.         filler1:                BOOLEAN;
  1449.         property:                INTEGER;
  1450.         theEvent:                ^EventRecord;                            {  -> The original event record of the key-press }
  1451.     END;
  1452.  
  1453.     DETPasteBlock = RECORD
  1454.         reqFunction:            DETCallFunctions;
  1455.         callBack:                DETCallBack;
  1456.         callBackPrivate:        LONGINT;
  1457.         templatePrivate:        LONGINT;
  1458.         instancePrivate:        LONGINT;
  1459.         target:                    DETTargetSpecification;
  1460.         targetIsMainAspect:        BOOLEAN;
  1461.         filler1:                BOOLEAN;
  1462.         property:                INTEGER;
  1463.         modifiers:                INTEGER;                                {  -> Modifiers at paste time (option/control/command/shift keys) }
  1464.     END;
  1465.  
  1466.     DETCustomMenuSelectedBlock = RECORD
  1467.         reqFunction:            DETCallFunctions;
  1468.         callBack:                DETCallBack;
  1469.         callBackPrivate:        LONGINT;
  1470.         templatePrivate:        LONGINT;
  1471.         instancePrivate:        LONGINT;
  1472.         target:                    DETTargetSpecification;
  1473.         targetIsMainAspect:        BOOLEAN;
  1474.         filler1:                BOOLEAN;
  1475.         menuTableParameter:        INTEGER;                                {  -> The "property" field from the custom menu table }
  1476.     END;
  1477.  
  1478.     DETCustomMenuEnabledBlock = RECORD
  1479.         reqFunction:            DETCallFunctions;
  1480.         callBack:                DETCallBack;
  1481.         callBackPrivate:        LONGINT;
  1482.         templatePrivate:        LONGINT;
  1483.         instancePrivate:        LONGINT;
  1484.         target:                    DETTargetSpecification;
  1485.         targetIsMainAspect:        BOOLEAN;
  1486.         filler1:                BOOLEAN;
  1487.         menuTableParameter:        INTEGER;                                {  -> The "property" field from the custom menu table }
  1488.         enable:                    BOOLEAN;                                { <-  Whether to enable the menu item }
  1489.         filler2:                BOOLEAN;
  1490.     END;
  1491.  
  1492.     DETForwarderListItemPtr = ^DETForwarderListItem;
  1493.  
  1494.     DETForwarderListItem = RECORD
  1495.         next:                    ^DETForwarderListItemPtr;                { Pointer to next item, or nil }
  1496.         attributeValueTag:        AttributeTag;                            { Tag of new templates (0 for none) }
  1497.         rstrs:                    PackedPathName;                            { Record type (empty if none), attrbute type (empty if none),
  1498.                                                 list of template names to forward to }
  1499.     END;
  1500.  
  1501.     DETForwarderListHandle = ^DETForwarderListItemPtr;
  1502.  
  1503.     DETDynamicForwardersBlock = RECORD
  1504.         reqFunction:            DETCallFunctions;
  1505.         callBack:                DETCallBack;
  1506.         callBackPrivate:        LONGINT;
  1507.         templatePrivate:        LONGINT;
  1508.         forwarders:                DETForwarderListHandle;                    { <-  List of forwaders }
  1509.     END;
  1510.  
  1511.     DETDynamicResourceBlock = RECORD
  1512.         reqFunction:            DETCallFunctions;
  1513.         callBack:                DETCallBack;
  1514.         callBackPrivate:        LONGINT;
  1515.         templatePrivate:        LONGINT;
  1516.         instancePrivate:        LONGINT;
  1517.         target:                    DETTargetSpecification;
  1518.         targetIsMainAspect:        BOOLEAN;
  1519.         filler1:                BOOLEAN;
  1520.         resourceType:            ResType;                                {  -> The resource type being requested }
  1521.         propertyNumber:            INTEGER;                                {  -> The property number of the resource being requested }
  1522.         resourceID:                INTEGER;                                {  -> The resource ID (base ID + property number) of the resource }
  1523.         theResource:            Handle;                                    { <-  The requested resource }
  1524.     END;
  1525.  
  1526.     DETCallBlock = RECORD
  1527.         CASE INTEGER OF
  1528.         0: (
  1529.             protoCall:                    DETProtoCallBlock;
  1530.            );
  1531.         1: (
  1532.             init:                        DETInitBlock;
  1533.            );
  1534.         2: (
  1535.             exit:                        DETExitBlock;
  1536.            );
  1537.         3: (
  1538.             instanceInit:                DETInstanceInitBlock;
  1539.            );
  1540.         4: (
  1541.             instanceExit:                DETInstanceExitBlock;
  1542.            );
  1543.         5: (
  1544.             instanceIdle:                DETInstanceIdleBlock;
  1545.            );
  1546.         6: (
  1547.             propertyCommand:            DETPropertyCommandBlock;
  1548.            );
  1549.         7: (
  1550.             maximumTextLength:            DETMaximumTextLengthBlock;
  1551.            );
  1552.         8: (
  1553.             viewListChanged:            DETViewListChangedBlock;
  1554.            );
  1555.         9: (
  1556.             propertyDirtied:            DETPropertyDirtiedBlock;
  1557.            );
  1558.         10: (
  1559.             validateSave:                DETValidateSaveBlock;
  1560.            );
  1561.         11: (
  1562.             dropQuery:                    DETDropQueryBlock;
  1563.            );
  1564.         12: (
  1565.             dropMeQuery:                DETDropMeQueryBlock;
  1566.            );
  1567.         13: (
  1568.             attributeCreationBlock:        DETAttributeCreationBlock;
  1569.            );
  1570.         14: (
  1571.             attributeNew:                DETAttributeNewBlock;
  1572.            );
  1573.         15: (
  1574.             attributeChange:            DETAttributeChangeBlock;
  1575.            );
  1576.         16: (
  1577.             attributeDelete:            DETAttributeDeleteBlock;
  1578.            );
  1579.         17: (
  1580.             itemNew:                    DETItemNewBlock;
  1581.            );
  1582.         18: (
  1583.             patternIn:                    DETPatternInBlock;
  1584.            );
  1585.         19: (
  1586.             patternOut:                    DETPatternOutBlock;
  1587.            );
  1588.         20: (
  1589.             shouldSync:                    DETShouldSyncBlock;
  1590.            );
  1591.         21: (
  1592.             doSync:                        DETDoSyncBlock;
  1593.            );
  1594.         22: (
  1595.             openSelf:                    DETOpenSelfBlock;
  1596.            );
  1597.         23: (
  1598.             convertToNumber:            DETConvertToNumberBlock;
  1599.            );
  1600.         24: (
  1601.             convertToRString:            DETConvertToRStringBlock;
  1602.            );
  1603.         25: (
  1604.             convertFromNumber:            DETConvertFromNumberBlock;
  1605.            );
  1606.         26: (
  1607.             convertFromRString:            DETConvertFromRStringBlock;
  1608.            );
  1609.         27: (
  1610.             customViewDraw:                DETCustomViewDrawBlock;
  1611.            );
  1612.         28: (
  1613.             customViewMouseDown:        DETCustomViewMouseDownBlock;
  1614.            );
  1615.         29: (
  1616.             keyPress:                    DETKeyPressBlock;
  1617.            );
  1618.         30: (
  1619.             paste:                        DETPasteBlock;
  1620.            );
  1621.         31: (
  1622.             customMenuSelected:            DETCustomMenuSelectedBlock;
  1623.            );
  1624.         32: (
  1625.             customMenuEnabled:            DETCustomMenuEnabledBlock;
  1626.            );
  1627.         33: (
  1628.             dynamicForwarders:            DETDynamicForwardersBlock;
  1629.            );
  1630.         34: (
  1631.             dynamicResource:            DETDynamicResourceBlock;
  1632.            );
  1633.     END;
  1634.  
  1635.     DETCallBlockPtr = ^DETCallBlock;
  1636.  
  1637. CONST
  1638.     uppDETCallBackProcInfo = $000003E0; { FUNCTION (4 byte param, 4 byte param): 2 byte result; }
  1639.  
  1640. FUNCTION CallDETCallBackProc(VAR callBlockPtr: DETCallBlock; callBackBlockPtr: DETCallBackBlockPtr; userRoutine: DETCallBackUPP): OSErr;
  1641.     {$IFC NOT GENERATINGCFM}
  1642.     INLINE $205F, $4E90;
  1643.     {$ENDC}
  1644.  
  1645. FUNCTION NewDETCallBackProc(userRoutine: DETCallBackProcPtr): DETCallBackUPP;
  1646.     {$IFC NOT GENERATINGCFM }
  1647.     INLINE $2E9F;
  1648.     {$ENDC}
  1649.  
  1650. CONST
  1651.     kDETCallForOther            = 1;                            { Call for things not listed below (also auto-enabled by DE if any of the below are enabled) }
  1652.     kDETCallForIdle                = 2;                            { kDETcmdIdle }
  1653.     kDETCallForCommands            = 4;                            { kDETcmdPropertyCommand, kDETcmdSelfOpen }
  1654.     kDETCallForViewChanges        = 8;                            { kDETcmdViewListChanged, kDETcmdPropertyDirtied, kDETcmdMaximumTextLength }
  1655.     kDETCallForDrops            = $10;                            { kDETcmdDropQuery, kDETcmdDropMeQuery }
  1656.     kDETCallForAttributes        = $20;                            { kDETcmdAttributeCreation, kDETcmdAttributeNew, kDETcmdAttributeChange, kDETcmdAttributeDelete }
  1657.     kDETCallForValidation        = $40;                            { kDETcmdValidateSave }
  1658.     kDETCallForKeyPresses        = $80;                            { kDETcmdKeyPress and kDETcmdPaste }
  1659.     kDETCallForResources        = $100;                            { kDETcmdDynamicResource }
  1660.     kDETCallForSyncing            = $200;                            { kDETcmdShouldSync, kDETcmdDoSync }
  1661.     kDETCallForEscalation        = $8000;                        { All calls escalated from the next lower level }
  1662.     kDETCallForNothing            = 0;                            { None of the above
  1663.     * All of the above }
  1664.     kDETCallForEverything        = $FFFFFFFF;
  1665.  
  1666. TYPE
  1667.     DETCallProcPtr = ProcPtr;  { FUNCTION DETCall(callBlockPtr: DETCallBlockPtr): OSErr; }
  1668.     DETCallUPP = UniversalProcPtr;
  1669.  
  1670. CONST
  1671.     uppDETCallProcInfo = $000000E0; { FUNCTION (4 byte param): 2 byte result; }
  1672.  
  1673. FUNCTION NewDETCallProc(userRoutine: DETCallProcPtr): DETCallUPP;
  1674.     {$IFC NOT GENERATINGCFM }
  1675.     INLINE $2E9F;
  1676.     {$ENDC}
  1677.  
  1678. FUNCTION CallDETCallProc(callBlockPtr: DETCallBlockPtr; userRoutine: DETCallUPP): OSErr;
  1679.     {$IFC NOT GENERATINGCFM}
  1680.     INLINE $205F, $4E90;
  1681.     {$ENDC}
  1682.     
  1683. TYPE
  1684.     DETCall = DETCallUPP;
  1685.  
  1686. { This following macro saves you from having to dig out the call-back pointer from the call block: }
  1687.  
  1688. CONST
  1689.     kSAMFirstDevProperty        = 40 + 10;
  1690.  
  1691. {
  1692.     SAM templates have additional resources/properties that are required
  1693.     for interaction with the AOCE Key Chain.
  1694.     
  1695.      Type    Offset                        Description
  1696.      ----    ------                        -----------
  1697.     'rstr'    kSAMAspectUserName            The user name
  1698.     'rstr'    kSAMAspectKind                The kind of SAM
  1699.     'detn'    kSAMAspectCannotDelete        If 0, then the slot cannot be deleted
  1700.     'sami'    kSAMAspectSlotCreationInfo    The info required to create a slot record
  1701. }
  1702.     kSAMAspectUserName            = 40 + 1;
  1703.     kSAMAspectKind                = 40 + 2;
  1704.     kSAMAspectCannotDelete        = 40 + 3;
  1705.     kSAMAspectSlotCreationInfo    = 40 + 4;
  1706.  
  1707. {*************************************************************************************
  1708.  ********************************* Admin Definitions: *********************************
  1709.  *************************************************************************************}
  1710.     kDETAdminVersion            = -978;
  1711.  
  1712.  
  1713. {$ALIGN RESET}
  1714. {$POP}
  1715.  
  1716. {$SETC UsingIncludes := OCETemplatesIncludes}
  1717.  
  1718. {$ENDC} {__OCETEMPLATES__}
  1719.  
  1720. {$IFC NOT UsingIncludes}
  1721.  END.
  1722. {$ENDC}
  1723.